<template>
  <div>
    <h4>你要购买的商品数量是:{{cons}}</h4>
    <button @click="addCount(50)">点我+</button>
    <button @click="romeCount">点我-</button>
  </div>
</template>

<script>
export default {
  name: 'VuecliDomeApp',

  data() {
    return {
      cons:0
    };
  },



  methods: {
    addCount(num){
      this.cons+=num
    },
    romeCount(){
      this.cons--
    }
  },
};
</script>

<style lang="scss" scoped>

</style>